package com.hnucm.c202001090145.service;

import com.hnucm.c202001090145.mapper.CourseMapper;
import com.hnucm.c202001090145.mapper.StudentMapper;
import com.hnucm.c202001090145.pojo.CourseOYH;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class StudentServiceImpl  implements StudentService{
    @Autowired
    StudentMapper studentMapper;
    @Autowired
    CourseMapper courseMapper;
    @Override
    public List<CourseOYH> findAllStuAndCourse() {

        return studentMapper.findAllStuAndCourse() ;
    }

    @Override
    @Transactional
    public int deleteStudentByNum(String num) {

        return studentMapper.deleteStudentByNum(num);
    }

    @Override
    public List<CourseOYH> findCourseByName(String name) {

        return courseMapper.findCourseByName(name);
    }
}
